﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SeguradoraIA.Class;

namespace SeguradoraIA.UserControl
{
    public partial class ucBotoesPadrao : System.Web.UI.UserControl
    {
        #region Sessao de Variaveis
        public bool ExibeBotaoSalvar = false;
        public bool ExibeBotaoEditar = false;
        public bool ExibeBotaoCancelar = false;
        public bool ExibeBotaoEnviar = false;
        public bool ExibeBotaoExcluir = false;
        public bool ExibeBotaoConsultar = false;
        public bool ExibeBotaoImprimir = false;
        public bool ExibeBotaoIncluir = false;
        public bool ExibeBotaoGerar = false;
        public bool ExibeBotaoPublicar = false;
        public bool ExibeBotaoImportar = false;
        public bool ExibeBotaoLimpar = false;
        public bool ExibeBotaoVoltar = false;
        public bool ExibeBotaoLogin = false;

        public bool InativaBotaoSalvar = false;
        public bool InativaBotaoEditar = false;
        public bool InativaBotaoCancelar = false;
        public bool InativaBotaoEnviar = false;
        public bool InativaBotaoExcluir = false;
        public bool InativaBotaoConsultar = false;
        public bool InativaBotaoImprimir = false;
        public bool InativaBotaoIncluir = false;
        public bool InativaBotaoGerar = false;
        public bool InativaBotaoPublicar = false;
        public bool InativaBotaoImportar = false;
        public bool InativaBotaoLimpar = false;
        public bool InativaBotaoVoltar = false;
        public bool InativaBotaoLogin = false;

        public ImageButton BtnConsultar 
        {
            get
            {
                return btnConsultar;
            }
        }

        public ImageButton BtnSalvar 
        {
            get 
            {
                return btnSalvar;
            }
        }

        public ImageButton BtnIncluir
        {
            get
            {
                return btnIncluir;
            }
        }

        public ImageButton BtnEnviar
        {
            get
            {
                return btnEnviar;
            }
        }

        public ImageButton BtnGerar
        {
            get
            {
                return btnGerar;
            }
        }

        public ImageButton BtnLogin
        {
            get
            {
                return btnLogin;
            }
        }

        public ImageButton BtnImportar
        {
            get
            {
                return btnImportar;
            }
        }

        public string ValidationGroupBtnSalvar
        {
            get
            {
                return ValidationGroupBtnSalvar;
            }
            set
            {
                this.btnSalvar.ValidationGroup = value;
            }
        }
        public string ValidationGroupBtnEditar
        {
            get
            {
                return ValidationGroupBtnEditar;
            }
            set
            {
                this.btnEditar.ValidationGroup = value;
            }
        }
        public string ValidationGroupBtnCancelar
        {
            get
            {
                return ValidationGroupBtnCancelar;
            }
            set
            {
                this.btnCancelar.ValidationGroup = value;
            }
        }
        public string ValidationGroupBtnEnviar
        {
            get
            {
                return ValidationGroupBtnEnviar;
            }
            set
            {
                this.btnEnviar.ValidationGroup = value;
            }
        }
        public string ValidationGroupBtnExcluir
        {
            get
            {
                return ValidationGroupBtnExcluir;
            }
            set
            {
                this.btnExcluir.ValidationGroup = value;
            }
        }
        public string ValidationGroupBtnConsultar
        {
            get
            {
                return ValidationGroupBtnConsultar;
            }
            set
            {
                this.btnConsultar.ValidationGroup = value;
            }
        }
        public string ValidationGroupBtnImprimir
        {
            get
            {
                return ValidationGroupBtnImprimir;
            }
            set
            {
                this.btnImprimir.ValidationGroup = value;
            }
        }
        public string ValidationGroupBtnPublicar
        {
            get
            {
                return ValidationGroupBtnPublicar;
            }
            set
            {
                this.btnPublicar.ValidationGroup = value;
            }
        }
        public string ValidationGroupBtnIncluir
        {
            get
            {
                return ValidationGroupBtnIncluir;
            }
            set
            {
                this.btnIncluir.ValidationGroup = value;
            }
        }
        public string ValidationGroupBtnGerar
        {
            get
            {
                return ValidationGroupBtnGerar;
            }
            set
            {
                this.btnGerar.ValidationGroup = value;
            }
        }
        public string ValidationGroupBtnImportar
        {
            get
            {
                return ValidationGroupBtnImportar;
            }
            set
            {
                this.btnImportar.ValidationGroup = value;
            }
        }
        public string ValidationGroupBtnLimpar
        {
            get
            {
                return ValidationGroupBtnLimpar;
            }
            set
            {
                this.btnLimpar.ValidationGroup = value;
            }
        }
        public string ValidationGroupBtnVoltar
        {
            get
            {
                return ValidationGroupBtnVoltar;
            }
            set
            {
                this.btnVoltar.ValidationGroup = value;
            }
        }
        public string ValidationGroupBtnLogin
        {
            get
            {
                return ValidationGroupBtnLogin;
            }
            set
            {
                this.btnLogin.ValidationGroup = value;
            }
        }

        #endregion

        #region Metodo - Page_Load
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }
        #endregion

        #region Metodo - ExibirBotoes
        public void ExibirBotoes()
        {
			this.tdSalvar.Visible = this.ExibeBotaoSalvar;
			this.tdCancelar.Visible = this.ExibeBotaoCancelar;            
            this.tdConsultar.Visible = this.ExibeBotaoConsultar;
            this.tdEditar.Visible = this.ExibeBotaoEditar;
            this.tdEnviar.Visible = this.ExibeBotaoEnviar;
            this.tdExcluir.Visible = this.ExibeBotaoExcluir;
            this.tdImportar.Visible = this.ExibeBotaoImportar;
            this.tdGerar.Visible = this.ExibeBotaoGerar;
            this.btnPublicar.Visible = this.ExibeBotaoPublicar;
            this.tdImprimir.Visible = this.ExibeBotaoImprimir;
            this.tdIncluir.Visible = this.ExibeBotaoIncluir;
            this.tdLimpar.Visible = this.ExibeBotaoLimpar;
            this.tdVoltar.Visible = this.ExibeBotaoVoltar;
            this.tdLogin.Visible = this.ExibeBotaoLogin;
        }
        #endregion

        #region Metodo - ExibirBotoes
        public void InativaBotoes()
        {
            this.btnSalvar.Enabled = this.InativaBotaoSalvar;
            this.btnCancelar.Enabled = this.InativaBotaoCancelar;
            this.btnConsultar.Enabled = this.InativaBotaoConsultar;
            this.btnEditar.Enabled = this.InativaBotaoEditar;
            this.btnEnviar.Enabled = this.InativaBotaoEnviar;
            this.btnExcluir.Enabled = this.InativaBotaoExcluir;
            this.btnImportar.Enabled = this.InativaBotaoImportar;
            this.btnGerar.Enabled = this.InativaBotaoGerar;
            this.btnPublicar.Enabled = this.InativaBotaoPublicar;
            this.btnImprimir.Enabled = this.InativaBotaoImprimir;
            this.btnIncluir.Enabled = this.InativaBotaoIncluir;
            this.btnLimpar.Enabled = this.InativaBotaoLimpar;
            this.btnVoltar.Enabled = this.InativaBotaoVoltar;
            this.btnLogin.Enabled = this.InativaBotaoLogin;
        }
        #endregion

        #region Metodo - AtribuirValidationGroup
        public void AtribuirValidationGroup()
        {
            this.btnSalvar.ValidationGroup = ValidationGroupBtnSalvar;
            this.btnEditar.ValidationGroup = ValidationGroupBtnEditar;
            this.btnCancelar.ValidationGroup = ValidationGroupBtnCancelar;
            this.btnEnviar.ValidationGroup = ValidationGroupBtnEnviar;
            this.btnExcluir.ValidationGroup = ValidationGroupBtnExcluir;
            this.btnConsultar.ValidationGroup = ValidationGroupBtnConsultar;
            this.btnImprimir.ValidationGroup = ValidationGroupBtnImprimir;
            this.btnIncluir.ValidationGroup = ValidationGroupBtnIncluir;
            this.btnGerar.ValidationGroup = ValidationGroupBtnGerar;
            this.btnLimpar.ValidationGroup = ValidationGroupBtnLimpar;
            this.btnVoltar.ValidationGroup = ValidationGroupBtnVoltar;
            this.btnLogin.ValidationGroup = ValidationGroupBtnLogin;
        }
        #endregion

        #region Metodo - btnSalvar_Click
        protected void btnSalvar_Click(object sender, EventArgs e)
        {
            ((PageBaseMaster)this.Page).Salvar();
        }
        #endregion

        #region Metodo - btnCancelar_Click
        protected void btnCancelar_Click(object sender, EventArgs e)
        {
			((PageBaseMaster)this.Page).Cancelar();
        }
        #endregion

        #region Metodo - btnConsultar_Click
        protected void btnConsultar_Click(object sender, EventArgs e)
        {
			((PageBaseMaster)this.Page).Consultar();
        }
        #endregion

        #region Metodo - btnEditar_Click
        protected void btnEditar_Click(object sender, EventArgs e)
        {
			((PageBaseMaster)this.Page).Editar();
        }
        #endregion

        #region Metodo - btnEnviar_Click
        protected void btnEnviar_Click(object sender, EventArgs e)
        {
			((PageBaseMaster)this.Page).Enviar();
        }
        #endregion

        #region Metodo - btnExcluir_Click
        protected void btnExcluir_Click(object sender, EventArgs e)
        {
			((PageBaseMaster)this.Page).Excluir();
        }
        #endregion

        #region Metodo - btnGerar_Click
        protected void btnGerar_Click(object sender, EventArgs e)
        {
			((PageBaseMaster)this.Page).Gerar();
        }
        #endregion

        #region Metodo - btnImportar_Click
        protected void btnImportar_Click(object sender, EventArgs e)
        {
			((PageBaseMaster)this.Page).Importar();
        }
        #endregion

        #region Metodo - btnImprimir_Click
        protected void btnImprimir_Click(object sender, EventArgs e)
        {
			((PageBaseMaster)this.Page).Imprimir();
        }
        #endregion

        #region Metodo - btnPublicar_Click
        protected void btnPublicar_Click(object sender, EventArgs e)
        {
			((PageBaseMaster)this.Page).Publicar();
        }
        #endregion

        #region Metodo - btnIncluir_Click
        protected void btnIncluir_Click(object sender, EventArgs e)
        {
			((PageBaseMaster)this.Page).Incluir();
        }
        #endregion

        #region Metodo - btnLimpar_Click
        protected void btnLimpar_Click(object sender, EventArgs e)
        {
			((PageBaseMaster)this.Page).Limpar();
        }
        #endregion

        #region Metodo - btnVoltar_Click
        protected void btnVoltar_Click(object sender, EventArgs e)
        {
			((PageBaseMaster)this.Page).Voltar();
        }
        #endregion

        #region Metodo - btnLogin_Click
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            ((PageBaseMaster)this.Page).Logar();
        }
        #endregion

		#region Metodo - btnGerar_OnClientClick

		public void btnGerar_OnClientClick(string JScript)
		{
			this.btnGerar.OnClientClick = JScript;
		}

		#endregion
	}
}